package com.jensen.dao;

import com.jensen.domain.User;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by Jensen on 2016/9/30.
 */
@Repository
public class UserDaoImpl extends BaseDaoImpl<User> implements UserDao {

    public void execByHql(String hql) {
        Query query=this.getCurrentSession().createQuery(hql);
        query.executeUpdate();
        System.out.println();
    }

    public void execBySql(String sql){
        Query query=this.getCurrentSession().createSQLQuery(sql);
        query.executeUpdate();
        System.out.println();
    }



}
